Rails.application.routes.draw do

  root :to=> 'home#index'
  concern :paginatable do
    get '(page/:page)', :action => :index, :on => :collection, :as => ''
  end
  resources :home do
    member do
      get 'twitter'
    end
  end
  resources :posts,:concerns => :paginatable
  resources :musics
  resource :twitters
  resource :users, only: [:create,:new]
  resource :sessions, only:[:new,:create,:destroy]
  resources :password_resets, only: [ :new, :create, :edit, :update]
  get 'signup', to: 'users#new', as: :signup
  get 'login', to: 'sessions#new', as: :login
  match 'logout', to: 'sessions#destroy', as: :logout,via: :all
  post 'upload' => 'upload#image'
end
